<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>引用类型</title>
  <style>
    * {
      margin: 0;
      padding: 0; 
      font-size: 14px;
      box-sizing: border-box
    }
    body {    
      padding: 20px;
    }
    div {
      line-height: 40px
    }
    h1 {
      font-size: 20px
    }
  </style>
</head>
<body>
  <h1>引用类型</h1>
  <div></div>
</body>
<script>
  function Person(name, sex) {
    /**
     * 实例属性方法
     */
    this.name = name;
    this.sex = sex;
    this.getName = function() {
      return this.name;
    }
  }
  /**
   * 类方法和属性
   */
  Person.height = 'haha';
  Person.test = function() {
    return 'haha'
  }
  /**
   * 原型属性和方法
   */
  Person.prototype.age = 23;
  Person.prototype.showName = function() {
    return this.name;
  }
  var person = new Person('zhangli', 'nan');
  var obj = {
    name: 'zhangli'
  }
  var arr = [1, 2, 3]
  function total(name, sex) {
    console.log(name)
  }
  console.dir(total);
</script>
</html>